package com.ztjava.weixin;

import com.jfinal.aop.Duang;
import com.jfinal.config.Constants;
import com.jfinal.config.Handlers;
import com.jfinal.config.Interceptors;
import com.jfinal.config.Plugins;
import com.jfinal.config.Routes;
import com.jfinal.plugin.redis.Cache;
import com.jfinal.plugin.redis.Redis;
import com.jfinal.template.Engine;
import com.ztjava.core.Constant;
import com.ztjava.core.base.BaseSub;
import com.ztjava.weixin.service.MessageService;

public class Weixin extends BaseSub{
	public final static String WEIXIN_LOGIN_OPENID = "WEIXIN_LOGIN_OPENID";

	@Override
	public void configConstant(Constants me) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void configRoute(Routes me) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void configEngine(Engine me) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void configPlugin(Plugins me) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void configInterceptor(Interceptors me) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void configHandler(Handlers me) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void afterJFinalStart() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void startComplete() {
		Cache cache = Redis.use();
		if(!cache.exists(Constant.R_PRE+"WEIXIN:MESSAGE:RULE")){
			MessageService messageService = Duang.duang(MessageService.class);
			messageService.loadRuleCache();
		}
	}

}
